UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'srycK02lGG3VEzCDMMJE/7a/4GEKPx2MofzOxx2xH/k='
WHERE
key_id = 'e4351ece02c84efb86bce8f8101808cc02c5295a395af44926f7da03fcf58751'
AND (
token = 'srycK02lGG3VEzCDMMJE/7a/4GEKPx2MofzOxx2xH/k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)