UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'z0DPq5ele5TL/OL4JojcpD1Ux+tS/Vd1IyEfW3PaIaI='
WHERE
key_id = '2a593145d9a380e1bc8acd0e64019f3fa2ccb5fbbd8253b19a8af242996d7669'
AND (
token = 'z0DPq5ele5TL/OL4JojcpD1Ux+tS/Vd1IyEfW3PaIaI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)