UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ae0g9mG3zs3FxUOrM44DwvILU5KCtObYZckkulNYg/I=' 
WHERE 
  key_id = '86c9616b415d8d4937ac6ccead71245f63d747bc16299ad9d00343bbe95f7506' 
  AND (
    token = 'ae0g9mG3zs3FxUOrM44DwvILU5KCtObYZckkulNYg/I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032