UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5mbrjHLTAwyJxl60A7Dh3+cJlMsc3+QPTyhLkCrX+pA='
WHERE
key_id = '9e0af68d06eee652fe3308c0a94615e5a0902b982a8923d1ed62458ecdfd6e68'
AND (
token = '5mbrjHLTAwyJxl60A7Dh3+cJlMsc3+QPTyhLkCrX+pA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)