UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zdwtgt3/cH8Lv8SjyV0lMXBj4/9Es+2iz8CubTtW3h0='
WHERE
key_id = 'c5ba50002e75ef079c5953cf3bf3d1a5e8ebe521519483e5c4f6970286a42c2f'
AND (
token = 'zdwtgt3/cH8Lv8SjyV0lMXBj4/9Es+2iz8CubTtW3h0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)