UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2eNzEqOHV/a4fdG5xZqCKQIHtn2LWyhGp+VODm3nOjU='
WHERE
key_id = 'b810ee808cc02d288d30cbdab86ae46243b5e83edefd9441707874544e52ad25'
AND (
token = '2eNzEqOHV/a4fdG5xZqCKQIHtn2LWyhGp+VODm3nOjU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)