UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'skAwh4bUneQeSWGGy8QDAgh+bEV80P7m8AlXLuA//lU='
WHERE
key_id = 'a0557123120977f309451e8a5239d750af47588c409ec59ec5924cb4c6660d27'
AND (
token = 'skAwh4bUneQeSWGGy8QDAgh+bEV80P7m8AlXLuA//lU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)