UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'FIygye2i+0PQaJeXCYBiv9g8lGJ1c+pTVsgA7/iBCMw='
WHERE
key_id = '6518cf50669c879841f869ab263c3de5790bff604a0dc53bb83bff014bf1c00e'
AND (
token = 'FIygye2i+0PQaJeXCYBiv9g8lGJ1c+pTVsgA7/iBCMw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)