UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'FV7v6RhuyHnJ5YKm3cxkY7hyCaJ+7QX2pocPE6dVfJ8='
WHERE
key_id = '648b3415ea1028ac62019ade308bc1de863c34453120f32cc7cbc4455361c813'
AND (
token = 'FV7v6RhuyHnJ5YKm3cxkY7hyCaJ+7QX2pocPE6dVfJ8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)