UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'XnpHY/U7s5KyGgt5rg0wwJveGAmoT4u4wcg28PWR1I0='
WHERE
key_id = '8be151d6726b56ccfff0d1a913df00cf4c0e8ab2bdc8d91205ab433158a505e6'
AND (
token = 'XnpHY/U7s5KyGgt5rg0wwJveGAmoT4u4wcg28PWR1I0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)