UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Qp+1CpY5+UOoWbAFUhVaDHuiKJ6j4ILGGT/4D5o2HDw=' 
WHERE 
  key_id = '440135319b072d230e9d21818ffda267ec7f2abf3b2943cffe05aae4e2d7924c' 
  AND (
    token = 'Qp+1CpY5+UOoWbAFUhVaDHuiKJ6j4ILGGT/4D5o2HDw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035