UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Pg6xVDqyzj+OZ7s43oice6SGVIz0g0131Gep0DmL6Og='
WHERE
key_id = '5fd6e6e13d44360c81f6793dd3b7801cad0313c87fb49a71cada2ded5add1b84'
AND (
token = 'Pg6xVDqyzj+OZ7s43oice6SGVIz0g0131Gep0DmL6Og='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)