UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4GIYDKcsrByjCFZdNR52Cnih/rswin2eDmAFfD1WZFA='
WHERE
key_id = 'e7635fce6c83f8fb7091f4c03912c274f90063935e9063e0b343e12c691ac34f'
AND (
token = '4GIYDKcsrByjCFZdNR52Cnih/rswin2eDmAFfD1WZFA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)