UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1Z+x57V5gj9dyZgsxPa4y9E8mfGMcN2vGRWeYVUWR1s='
WHERE
key_id = 'a64440e4679180ee6558c38516864f22e6d0fa4420a4fbd83602f1846a1e27d1'
AND (
token = '1Z+x57V5gj9dyZgsxPa4y9E8mfGMcN2vGRWeYVUWR1s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)