UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'sMLmTxQPE3XNVdytyCtDe5E4/2KjatnRnyYvcV4Z07o='
WHERE
key_id = '55477bd46eb72769975058ab1d162c39d340834a552f145849ed55f8f4c52fff'
AND (
token = 'sMLmTxQPE3XNVdytyCtDe5E4/2KjatnRnyYvcV4Z07o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)