UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'S4qcs/oNIoUytDIR0sE46m4xQpA5Cy5q0q9YwgD3hQw='
WHERE
key_id = 'ab27caa3d6abdd12909c5cccadeb8857127e4fb5b7919186225d9fa90b9a1e85'
AND (
token = 'S4qcs/oNIoUytDIR0sE46m4xQpA5Cy5q0q9YwgD3hQw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)