UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'g4fYUxU3iWVwRzAfnvdePMJbFYtRmSTkqd/MQiHfLLo='
WHERE
key_id = 'ef8e02d53b5ceffbdcb2450af9ce0827e5b3673f0f6607ce7fcb2ebc64c7c126'
AND (
token = 'g4fYUxU3iWVwRzAfnvdePMJbFYtRmSTkqd/MQiHfLLo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)