UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'JjEq3/aHsN9D3jUjqqwwd2WmB6z3BIVwmDUl07BUKyc=' 
WHERE 
  key_id = '908e601e31c5af89e949083294227f844483bd0c771f708f2dac68cea25eec6e' 
  AND (
    token = 'JjEq3/aHsN9D3jUjqqwwd2WmB6z3BIVwmDUl07BUKyc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027