UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QDDlpu6tuDU06ZQ5EUCcz2pQVUFfCv3bRbre3cmJFqA='
WHERE
key_id = '3eb533622f49457af54f134fb347082f5d5eabd43ad52c70a0cbfcae0b5d409d'
AND (
token = 'QDDlpu6tuDU06ZQ5EUCcz2pQVUFfCv3bRbre3cmJFqA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)