UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'z5uT3dkNRkEfe0BjQSeFkoSARaxtS+4HMZfHzt6ILAw='
WHERE
key_id = '6aa07308aa6a7e0389a14bef93f0d825b329943fa486cae3bb08f0bebd946226'
AND (
token = 'z5uT3dkNRkEfe0BjQSeFkoSARaxtS+4HMZfHzt6ILAw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)