UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4wpSaFtuhfsW8xmsuQhwVFF3STIKu7PThyK93U+Z5aY='
WHERE
key_id = 'd403db9571d9c92dc1d12df567a56cd24eff11cf5234ea586d49dc58ade05c88'
AND (
token = '4wpSaFtuhfsW8xmsuQhwVFF3STIKu7PThyK93U+Z5aY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)