UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GkWFQbJJWb8U7I7Dg8FBMp3wm30BjF+trsZSC3ib6EI='
WHERE
key_id = '09d105f233097350e74a75fc30f7144048cd01163e5551321d568a504b0af931'
AND (
token = 'GkWFQbJJWb8U7I7Dg8FBMp3wm30BjF+trsZSC3ib6EI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)