UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'EwlsQax9tPHXQjSsh3DftmO7mInfO3rmyh099JUyWl8='
WHERE
key_id = 'cbfc24ed3f37c8288759147c113adc5893c634280be00a26377d329b7dba6275'
AND (
token = 'EwlsQax9tPHXQjSsh3DftmO7mInfO3rmyh099JUyWl8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)