UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JTCvIBOOCqUEonyw5WFvTflyjTxLiTxgmJZSPROI6Is='
WHERE
key_id = '2e6a980640d46099d62151aea09c446c1749f7c6ca75728c9eb45761aff3244d'
AND (
token = 'JTCvIBOOCqUEonyw5WFvTflyjTxLiTxgmJZSPROI6Is='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)