UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ykFdX33le5kYD0zm7RX42BWK1MtqGkrjyLiqCtnGhpY=' 
WHERE 
  key_id = 'b0338b988f18ca8efb61b9870b1ab2900fa55d8a52d6c982f5e6770fb2775299' 
  AND (
    token = 'ykFdX33le5kYD0zm7RX42BWK1MtqGkrjyLiqCtnGhpY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043