UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7UY+L7OrRz+2RruHd+MqDTf+ozC0JCDvGvV/DJ8dRt4='
WHERE
key_id = '589564d2de7ed37d120c47e1b9a60b3566cccd231503cbd51b8d2e50a595542d'
AND (
token = '7UY+L7OrRz+2RruHd+MqDTf+ozC0JCDvGvV/DJ8dRt4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)