UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'i5V+J6gwb+Zc6Aggvgb7Ii+PaQM7Tj48spBOz8lUs2U='
WHERE
key_id = 'ff99dc5c9a9582b62edddf354ff323f6e82745a83f3f2a44f2c792b837e82ccf'
AND (
token = 'i5V+J6gwb+Zc6Aggvgb7Ii+PaQM7Tj48spBOz8lUs2U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)