UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9zOAiMo+fO7P357o11eGrP0aCbBdpXBROoLox5UX96g='
WHERE
key_id = 'cc1254bb44af76db6a6f3c1562f4a2a400f8fc96db1023c6d587dc765a064640'
AND (
token = '9zOAiMo+fO7P357o11eGrP0aCbBdpXBROoLox5UX96g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)