UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kN2zxP7lEYit4gsXe5eKdha01EB39lMLfFokWR1PbNA='
WHERE
key_id = '16ecb02c5ea79a82df924fbe85cd944b2e9944ed141d1ff71148ba64a58bc9c2'
AND (
token = 'kN2zxP7lEYit4gsXe5eKdha01EB39lMLfFokWR1PbNA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)