UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'eZita2RBhfSpxanP5ZLqKTZcJt4PIF65NxPnwt4UCmQ='
WHERE
key_id = 'd6094c23e4bf51dffcef16c47c3c2036e603113edfebda85e36a9211f29b7019'
AND (
token = 'eZita2RBhfSpxanP5ZLqKTZcJt4PIF65NxPnwt4UCmQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)